package com.design.designmode.struct.agency;

/**
 * @author hxl
 * @since 2023-04-17
 */
public class Proxy implements Subject {


    protected RealSubject subject;

    public Proxy(RealSubject subject) {
        this.subject = subject;
    }

    @Override
    public void buy() {
        System.out.println("办理购买前的手续");
        subject.buy(); // 付钱
        System.out.println("办理购买后的手续");
    }
}
